// import request from '@/utils/request1'

// export const login = ({adminname,password})=>{
//   return request({
//     url:'admin/login',
//     method:'POST',
//     data:{
//       adminname,
//       password
//     }
//   })
// }

import request from '@/utils/request'

export function data_today(query) {
    return request({
        url: 'data/today',
        method: 'get',
        params: query
    })
}
export function warn_chart(query) {
    return request({
        url: 'data/warn/chart',
        method: 'get',
        params: query
    })
}
export function device_map(query) {
    return request({
        url: 'data/device/map',
        method: 'get',
        params: query
    })
}
export function area_list(query) {
    return request({
        url: 'area/list',
        method: 'get',
        params: query
    })
}
export function storage_map(query) {
    return request({
        url: 'data/storage/map',
        method: 'get',
        params: query
    })
}
export function warning_list(query) {
    return request({
        url: 'warning/list',
        method: 'get',
        params: query
    })
}
export function storage_hatch(query) {
    return request({
        url: 'data/storage/hatch',
        method: 'get',
        params: query
    })
}
export function storage_percent(query) {
    return request({
        url: 'data/storage/percent',
        method: 'get',
        params: query
    })
}
export function device_info(query) {
    return request({
        url: '/device/info',
        method: 'get',
        params: query
    })
}
export function playback_list(query) {
    return request({
        url: 'playback/list',
        method: 'get',
        params: query
    })
}
// export function storage_percent(query) {
//     return request({
//         url: 'warning/list',
//         method: 'get',
//         params: query
//     })
// }
export function device_count(query) {
    return request({
        url: 'data/device/count',
        method: 'get',
        params: query
    })
}
export function device_list(query) {
    return request({
        url: 'data/device/list',
        method: 'get',
        params: query
    })
}

export function device_gas(query) {
    return request({
        url: 'data/device/gas',
        method: 'get',
        params: query
    })
}

export function device_ctl(data) {
    return request({
        url: 'data/device/ctl',
        method: 'post',
        data
    })
}

export function device_talk(data) {
    return request({
        url: 'data/device/talk',
        method: 'post',
        data
    })
}

export function device_play(data) {
    return request({
        url: 'device/play',
        method: 'post',
        data
    })
}
export function device_stop(data) {
    /**
     * 发送POST请求停止设备
     * @param {Object} data - 请求的数据
     * @return {Promise} - 请求的Promise对象
     */
    return request({
        url: 'device/stop',
        method: 'post',
        data
    })
}
export function talk_url(query) {
    return request({
        url: 'device/talk/url',
        method: 'get',
        params: query
    })
}
export function talk_start(data) {
    /**
     * 发送POST请求停止设备
     * @param {Object} data - 请求的数据
     * @return {Promise} - 请求的Promise对象
     */
    return request({
        url: 'device/talk',
        method: 'post',
        data
    })
}
export function talk_stop(data) {
    /**
     * 发送POST请求停止设备
     * @param {Object} data - 请求的数据
     * @return {Promise} - 请求的Promise对象
     */
    return request({
        url: 'device/talk/stop',
        method: 'post',
        data
    })
}

export function device_light(data) {
    /**
     * 发送POST请求停止设备
     * @param {Object} data - 请求的数据
     * @return {Promise} - 请求的Promise对象
     */
    return request({
        url: 'device/light',
        method: 'post',
        data
    })
}